from django.db import models

# Create your models here.
from apps.index.models import User


class Article(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='用户')
    title =models.CharField(max_length=20, verbose_name='名称')
    content =models.TextField(verbose_name='内容')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    create_time2 =models.CharField(max_length=30, verbose_name='创建时间2', null=True)
    browse =models.CharField(max_length=20, verbose_name='浏览量', null=True)

    objects = models.Manager()

    class Meta:
        db_table = 'article'
        verbose_name = '发布博客'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title